![]() |
PATH![]() |
![]() ![]() |
The following Dialog Manager functions for creating dialog boxes are new, changed, or not recommended with Appearance Manager 1.0:
Creates a dialog box from a resource-based description.
pascal DialogPtr GetNewDialog (
short dialogID,
void *dStorage,
WindowPtr behind);
The GetNewDialog function creates a dialog structure from information in a dialog resource and an extended dialog resource (if it exists) and returns a pointer to the dialog structure. You can use this pointer with Window Manager or QuickDraw functions to manipulate the dialog box. If the dialog resource specifies that the dialog box should be visible, the dialog box is displayed. If the dialog resource specifies that the dialog box should initially be invisible, use the Window Manager function ShowWindow to display the dialog box.
The dialog resource contains a resource ID that specifies both the dialog box's item list ('DITL') resource and its dialog font table ('dftb') resource. After calling the Resource Manager to read these resources into memory (if they are not already in memory), GetNewDialog makes a copy of the 'DITL' resource and uses that copy; thus you may have several dialog boxes with identical items.
If you supply a dialog color table ('dctb') resource with the same resource ID as the dialog resource, GetNewDialog uses NewColorDialog and returns a pointer to a color graphics port. If no dialog color table resource is present, GetNewDialog uses NewDialog to return a pointer to a black-and-white graphics port, although system software draws the window frame using the system's default colors. However, if the Appearance Manager is available and the kDialogFlagsUseThemeBackground feature bit of the extended dialog resource is set, then the 'dctb' resource is ignored and a color graphics port is created.
The GetNewDialog function doesn't release the memory occupied by the resources. Therefore, your application should mark all resources used for a dialog box as purgeable or you should release the resources yourself.
If either the dialog resource or the item list resource can't be read, the function result is nil ; your application should test to ensure that nil is not returned before performing any more operations with the dialog box or its items.
As with all other windows, dialogs are created with an update region equal to their port rectangle. However, if the dialog's 'DLOG' resource specifies that the dialog be made visible upon creation, the Dialog Manager draws the controls immediately and calls ValidRgn for each of their bounding rectangles. Other items are not drawn until the first update event for the dialog box is serviced.
If you need to display an alert box while your application is running in the background or is otherwise invisible to the user, call AEInteractWithUser ; see Inside Macintosh: Interapplication Communication.
Creates a dialog box from information passed in memory.
pascal DialogPtr NewFeaturesDialog (
void *inStorage,
const Rect *inBoundsRect,
ConstStr255Param inTitle,
Boolean inIsVisible,
SInt16 inProcID,
WindowPtr inBehind,
Boolean inGoAwayFlag,
SInt32 inRefCon,
Handle inItemListHandle,
UInt32 inFlags);
The NewFeaturesDialog function creates a dialog box without using 'DLOG' or 'dlgx' resources. Although the inItemListHandle parameter specifies an item list ('DITL') resource for the dialog box, the corresponding dialog font table ( 'dftb' ) resource is not automatically accessed. You must explicitly set the dialog box's control font style(s) individually.